// JavaScript Document


function all_count()
{
try{
	var sql="select count(id) as cnt from account ";
	var dsl="	com.attilax.ioc.Ioc4agent.getBean(com.attilax.db.DbServiceV4qb9.class).executeQuery('$s$')";
	dsl=dsl.replace("$s$",sql);
	
		var jsbrj=new	AtiJsBridge();
	//	jsbrj.method="post";
		var para={};
		para.dsl=dsl;
		para.retFmt="json";
		jsbrj.exe(para,function(data){
			console.log(data);
			//$("#content").val(data);
			
			
			 var json=JSON.parse(data); //( data );			 	 
		  	var obj=json[0];
			$("#cnt").text(obj.cnt);
		//	$("#r").text(obj.roomCount);
			
		});
			//mycallJava("submitx",$("#title").val(),$("#content").val(),dropIds);
		}catch(e)
		{
			alert(e);
		}
		
}

function hiagt_calc()
{
	 var sql="select count(*)  cnt   from hiagt  "; 
 
			var orm=new atiOrmV5();
		orm.iniQbj();
		orm.obj=sql ;
	    orm.metaParam="retFmt=json";
		 
	orm.callbackFun=function(data)
	{
		
			try{
			  processJavaEx_V2q315(data);
		   }catch(e)
		   {
			 
				 
				  showErr(e);
				  return;
		  
		   }
		   var json=str2json(data);
		 	var obj=json[0];
			$("#hiagt_cnt").text(obj.cnt);
		  
		   
	};
	orm.query();
	
}

$(function(){
	
	  writeCookie("index_url","../uc/uc_adm.htm",9); 
	all_count(
		function(rzt){ 
			 $("#todaySum").text(rzt);
		}
	
	);
	all_rechg(
		
			function(rzt){ 
				$("#allSum").text(rzt);
			}
		
		);
		
		today_rechg(
		
			function(rzt){ 
				$("#todaySum").text(rzt);
			}
		
		);
		
		
		
		 var sql="select count(*) agt_cnt   from agent  "; 
    
		var orm=new atiOrmV5();
		orm.iniQbj();
		orm.obj=sql ;
	    orm.metaParam="retFmt=json";
		 
	orm.callbackFun=function(data)
	{
		
			try{
			  processJavaEx_V2q315(data);
		   }catch(e)
		   {
			 
				 
				  showErr(e);
				  return;
		  
		   }
		   var json=str2json(data);
		 	var obj=json[0];
			$("#agt_cnt").text(obj.agt_cnt);
		  
		   
	};
	orm.query();
	
	hiagt_calc();

}); 

